/*
 * 系统设置
 * */

import http from '@/utils/http';

/*
 * 账号设置
 * */

// 账号设置 修改用户昵称
// eslint-disable-next-line import/prefer-default-export
export async function accountUpdateNick(params) {
  return http.post('/cloud/user/updateNick', params);
}

// 账号设置 发送手机验证码
export async function accountCode(params) {
  return http.post('/cloud/guest/sendSMS4BindPhoneJson', params);
}

// 账号设置 修改手机号
export async function accountUpdatePhone(params) {
  return http.post('/cloud/user/updatePhone', params);
}

// 账号设置 修改用户密码
export async function accountUpdatePassword(params) {
  return http.post('/cloud/user/updatePassword', params);
}

/*
 * 机器人设置
 * */

// 机器人设置 重启机器人
export async function robotSetupRestart(params) {
  return http.get('/cloud/robot/restart', params);
}

// 机器人设置保存修改
export async function robotSetupSaveEditInfo(params) {
  return http.post('/cloud/new/system/robot/set/saveEditInfo', params);
}

// 账号管理

export async function loadUsersJson(params) {
  return http.post('/cloud/new/system/account/getUserList', params);
}

// 添加账号

export async function saveUser(params) {
  return http.postWithStatus('/cloud/user/saveUser', params);
}

// 删除账号

export async function deleteUser(params) {
  return http.post('/cloud/user/deleteUser', params);
}

// 编辑账号

export async function editUserInfoNew(params) {
  return http.post('/cloud/user/editUserInfoNew', params);
}

// 重置用户密码

export async function resetUserPassword(params) {
  return http.post('/cloud/user/resetUserPassword', params);
}

// 机器人设置 获取机器人设置信息
export async function robotGetRobotSetting(params) {
  return http.post('/cloud/new/system/robot/set/getRobotSetting', params);
}

/*
 * 接入设置
 * */

// 保存接入设置
export async function saveSettings(params) {
  return http.post('/setLink/saveLink', params);
}

// 接入设置 获取网站接入信息
export async function webSettingInfo(params) {
  return http.getToken('/cloud/new/system/access/set/webSettingInfo', params);
}

// 接入设置 保存网站设置
export async function saveWebSetting(params) {
  return http.post('/cloud/new/system/access/set/saveWebSetting', params);
}

// 接入设置上传图片接口
export async function accountUpload(params) {
  return http.post('/cloud/res/upload', params);
}

// 授权公众号查询接口
export async function accountWeChatList(params) {
  return http.post('/cloud/robot/weChatList', params);
}

// 接入设置 保存app设置
export async function saveAppSetting(params) {
  return http.post('/cloud/new/system/access/set/saveAppSetting', params);
}

// 接入设置 获取app接入信息
export async function appSettingInfo(params) {
  return http.getToken('/cloud/new/system/access/set/appSettingInfo', params);
}

// 角色管理

// 问答记录 -- 关联列表
export async function fakeAnswerRelevanceData(params) {
  return http.post('/cloud/new/learn/wait/ques/relation/question', params);
}

// 问答记录 -- 关联列表 --关联知识点
export async function fakeAnswerRelevanceknowledgeData(params) {
  return http.post('/cloud/new//stat/qa/record/relationQa', params);
}

export async function sysgetmenusByUserId(params) {
  return http.getTokenData('/cloud/new/sys/getmenusByUserId', params);
}
